<?php
namespace app\run\model;

use think\Model;
use think\Db;
class Image extends Model{
     public static function addImg(array $data){
    	$res = Db::name('image')->insert($data);
    	if($res){
    		$res = Db::name('image')->getLastInsID();
    	}
    	return $res;
    }
    public static function updateImg(array $data){
    	$res = Db::name('image')->update($data);
    	
    	return $res;
    }

    public static function img($id){
    	$res = Db::name('image')->field('url,id')->where('id',$id)->find();
    	return $res;
    }

      public static function cat(){
        $res = Db::name('image')->field('url,id')->select();
        return $res;
    }
}